using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialStatisticsTools._ModelingSpatialRelationships
{
    /// <summary>
    /// <para>Generate Network Spatial Weights</para>
    /// <para>Constructs a spatial weights matrix file (.swm) using a Network dataset, defining feature spatial relationships in terms of the underlying network structure.</para>
    /// <para>使用网络数据集构建空间权重矩阵文件 （.swm），根据底层网络结构定义要素空间关系。</para>
    /// </summary>    
    [DisplayName("Generate Network Spatial Weights")]
    public class GenerateNetworkSpatialWeights : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public GenerateNetworkSpatialWeights()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_Input_Feature_Class">
        /// <para>Input Feature Class</para>
        /// <para>The point feature class for which network spatial relationships among features will be assessed.</para>
        /// <para>将评估要素之间网络空间关系的点要素类。</para>
        /// </param>
        /// <param name="_Unique_ID_Field">
        /// <para>Unique ID Field</para>
        /// <para>An integer field containing a different value for every feature in the input feature class. If you don't have a Unique ID field, you can create one by adding an integer field to your feature class table and calculating the field values to equal the FID or OBJECTID field.</para>
        /// <para>一个整数字段，其中包含输入要素类中每个要素的不同值。如果没有唯一 ID 字段，则可以通过向要素类表添加整数字段并计算字段值以等于 FID 或 OBJECTID 字段来创建一个字段。</para>
        /// </param>
        /// <param name="_Output_Spatial_Weights_Matrix_File">
        /// <para>Output Spatial Weights Matrix File</para>
        /// <para>The output network spatial weights matrix (.swm) file.</para>
        /// <para>输出网络空间权重矩阵 （.swm） 文件。</para>
        /// </param>
        /// <param name="_Input_Network">
        /// <para>Input Network</para>
        /// <para>The network dataset for which spatial relationships among features in the input feature class will be defined. Network datasets most often represent street networks but may represent other kinds of transportation networks as well. The network dataset needs at least one time-based and one distance-based cost attribute.</para>
        /// <para>将为其定义输入要素类中要素之间的空间关系的网络数据集。网络数据集通常表示街道网络，但也可能表示其他类型的交通网络。网络数据集至少需要一个基于时间的成本属性和一个基于距离的成本属性。</para>
        /// </param>
        /// <param name="_Impedance_Attribute">
        /// <para>Impedance Attribute</para>
        /// <para>The type of cost units to use as impedance in the analysis.</para>
        /// <para>在分析中用作阻抗的成本单位的类型。</para>
        /// </param>
        public GenerateNetworkSpatialWeights(object _Input_Feature_Class, object _Unique_ID_Field, object _Output_Spatial_Weights_Matrix_File, object _Input_Network, object _Impedance_Attribute)
        {
            this._Input_Feature_Class = _Input_Feature_Class;
            this._Unique_ID_Field = _Unique_ID_Field;
            this._Output_Spatial_Weights_Matrix_File = _Output_Spatial_Weights_Matrix_File;
            this._Input_Network = _Input_Network;
            this._Impedance_Attribute = _Impedance_Attribute;
        }
        public override string ToolboxName => "Spatial Statistics Tools";

        public override string ToolName => "Generate Network Spatial Weights";

        public override string CallName => "stats.GenerateNetworkSpatialWeights";

        public override List<string> AcceptEnvironments => ["scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_Input_Feature_Class, _Unique_ID_Field, _Output_Spatial_Weights_Matrix_File, _Input_Network, _Impedance_Attribute, _Impedance_Cutoff, _Maximum_Number_of_Neighbors, _Barriers, _U_turn_Policy.GetGPValue(), _Restrictions, _Use_Hierarchy_in_Analysis.GetGPValue(), _Search_Tolerance, _Conceptualization_of_Spatial_Relationships.GetGPValue(), _Exponent, _Row_Standardization.GetGPValue(), _Travel_Mode, _Time_of_Day];

        /// <summary>
        /// <para>Input Feature Class</para>
        /// <para>The point feature class for which network spatial relationships among features will be assessed.</para>
        /// <para>将评估要素之间网络空间关系的点要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Input_Feature_Class { get; set; }


        /// <summary>
        /// <para>Unique ID Field</para>
        /// <para>An integer field containing a different value for every feature in the input feature class. If you don't have a Unique ID field, you can create one by adding an integer field to your feature class table and calculating the field values to equal the FID or OBJECTID field.</para>
        /// <para>一个整数字段，其中包含输入要素类中每个要素的不同值。如果没有唯一 ID 字段，则可以通过向要素类表添加整数字段并计算字段值以等于 FID 或 OBJECTID 字段来创建一个字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Unique ID Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Unique_ID_Field { get; set; }


        /// <summary>
        /// <para>Output Spatial Weights Matrix File</para>
        /// <para>The output network spatial weights matrix (.swm) file.</para>
        /// <para>输出网络空间权重矩阵 （.swm） 文件。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Spatial Weights Matrix File")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Output_Spatial_Weights_Matrix_File { get; set; }


        /// <summary>
        /// <para>Input Network</para>
        /// <para>The network dataset for which spatial relationships among features in the input feature class will be defined. Network datasets most often represent street networks but may represent other kinds of transportation networks as well. The network dataset needs at least one time-based and one distance-based cost attribute.</para>
        /// <para>将为其定义输入要素类中要素之间的空间关系的网络数据集。网络数据集通常表示街道网络，但也可能表示其他类型的交通网络。网络数据集至少需要一个基于时间的成本属性和一个基于距离的成本属性。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Network")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Input_Network { get; set; }


        /// <summary>
        /// <para>Impedance Attribute</para>
        /// <para>The type of cost units to use as impedance in the analysis.</para>
        /// <para>在分析中用作阻抗的成本单位的类型。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Impedance Attribute")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Impedance_Attribute { get; set; }


        /// <summary>
        /// <para>Impedance Cutoff</para>
        /// <para><xdoc>
        ///   <para>Specifies a cutoff value for Inverse and Fixed conceptualizations of spatial relationships. Enter this value using the units specified by the Impedance Attribute parameter.</para>
        ///   <para>A value of zero indicates that no threshold is applied. When this parameter is left blank, a default threshold value is computed based on input feature class extent and the number of features.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定空间关系的反向概念化和固定概念化的截止值。使用阻抗属性参数指定的单位输入此值。</para>
        ///   <para>值为零表示未应用阈值。如果此参数留空，则将根据输入要素类范围和要素数量计算默认阈值。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Impedance Cutoff")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _Impedance_Cutoff { get; set; } = null;


        /// <summary>
        /// <para>Maximum Number of Neighbors</para>
        /// <para>An integer reflecting the maximum number of neighbors to find for each feature.</para>
        /// <para>一个整数，用于反映要为每个要素查找的最大相邻节点数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Number of Neighbors")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _Maximum_Number_of_Neighbors { get; set; } = null;


        /// <summary>
        /// <para>Barriers</para>
        /// <para>The name of a point feature class with features representing blocked intersections, road closures, accident sites, or other locations where travel is blocked along the network.</para>
        /// <para>具有表示网络上受阻交叉口、道路封闭、事故现场或其他交通受阻位置的点要素类的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Barriers")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _Barriers { get; set; } = null;


        /// <summary>
        /// <para>U-turn Policy</para>
        /// <para><xdoc>
        ///   <para>Specifies optional U-turn restrictions.</para>
        ///   <bulletList>
        ///     <bullet_item>Allow U-turns—U-turns will be allowed anywhere. This is the default.</bullet_item><para/>
        ///     <bullet_item>No U-turns—No U-turns will be allowed during navigation.</bullet_item><para/>
        ///     <bullet_item>Allow U-turns at dead ends only—U-turns will be allowed only at dead ends (that is, single-valent junctions).</bullet_item><para/>
        ///     <bullet_item>Allow U-turns at dead ends and intersections only—U-turns will be allowed only at dead ends and intersections.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定可选的掉头限制。</para>
        ///   <bulletList>
        ///     <bullet_item>允许掉头—任何地方都允许掉头。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>禁止掉头—导航期间不允许掉头。</bullet_item><para/>
        ///     <bullet_item>仅允许在死角掉头 - 只允许在死角（即单价路口）掉头。</bullet_item><para/>
        ///     <bullet_item>仅允许在死胡同和交叉路口掉头 - 只允许在死胡同和交叉路口掉头。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("U-turn Policy")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _U_turn_Policy_value _U_turn_Policy { get; set; } = _U_turn_Policy_value._ALLOW_UTURNS;

        public enum _U_turn_Policy_value
        {
            /// <summary>
            /// <para>Allow U-turns</para>
            /// <para>Allow U-turns—U-turns will be allowed anywhere. This is the default.</para>
            /// <para>允许掉头—任何地方都允许掉头。这是默认设置。</para>
            /// </summary>
            [Description("Allow U-turns")]
            [GPEnumValue("ALLOW_UTURNS")]
            _ALLOW_UTURNS,

            /// <summary>
            /// <para>No U-turns</para>
            /// <para>No U-turns—No U-turns will be allowed during navigation.</para>
            /// <para>禁止掉头—导航期间不允许掉头。</para>
            /// </summary>
            [Description("No U-turns")]
            [GPEnumValue("NO_UTURNS")]
            _NO_UTURNS,

            /// <summary>
            /// <para>Allow U-turns at dead ends only</para>
            /// <para>Allow U-turns at dead ends only—U-turns will be allowed only at dead ends (that is, single-valent junctions).</para>
            /// <para>仅允许在死角掉头 - 只允许在死角（即单价路口）掉头。</para>
            /// </summary>
            [Description("Allow U-turns at dead ends only")]
            [GPEnumValue("ALLOW_DEAD_ENDS_ONLY")]
            _ALLOW_DEAD_ENDS_ONLY,

            /// <summary>
            /// <para>Allow U-turns at dead ends and intersections only</para>
            /// <para>Allow U-turns at dead ends and intersections only—U-turns will be allowed only at dead ends and intersections.</para>
            /// <para>仅允许在死胡同和交叉路口掉头 - 只允许在死胡同和交叉路口掉头。</para>
            /// </summary>
            [Description("Allow U-turns at dead ends and intersections only")]
            [GPEnumValue("ALLOW_DEAD_ENDS_AND_INTERSECTIONS_ONLY")]
            _ALLOW_DEAD_ENDS_AND_INTERSECTIONS_ONLY,

        }

        /// <summary>
        /// <para>Restrictions</para>
        /// <para>A list of restrictions. Check the restrictions to be honored in spatial relationship computations.</para>
        /// <para>限制列表。检查空间关系计算中要遵守的限制。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Restrictions")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _Restrictions { get; set; } = null;


        /// <summary>
        /// <para>Use Hierarchy in Analysis</para>
        /// <para><xdoc>
        ///   <para>Specifies whether to use a hierarchy in the analysis.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The network dataset's hierarchy attribute will be used in a heuristic path algorithm to speed analysis.</bullet_item><para/>
        ///     <bullet_item>Unchecked—An exact path algorithm will be used instead. If there is no hierarchy attribute, this option does not affect analysis.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否在分析中使用层次结构。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 网络数据集的层次属性将在启发式路径算法中使用以加快分析速度。</bullet_item><para/>
        ///     <bullet_item>未选中—将改用精确路径算法。如果没有层次结构属性，则此选项不会影响分析。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Use Hierarchy in Analysis")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _Use_Hierarchy_in_Analysis_value _Use_Hierarchy_in_Analysis { get; set; } = _Use_Hierarchy_in_Analysis_value._false;

        public enum _Use_Hierarchy_in_Analysis_value
        {
            /// <summary>
            /// <para>USE_HIERARCHY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("USE_HIERARCHY")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_HIERARCHY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_HIERARCHY")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Search Tolerance</para>
        /// <para>The search threshold used to locate features in the Input Feature Class onto the network dataset. This parameter includes a search value and the units for the tolerance.</para>
        /// <para>用于将输入要素类中的要素定位到网络数据集上的搜索阈值。此参数包括搜索值和公差单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _Search_Tolerance { get; set; } = "5000 Meters";


        /// <summary>
        /// <para>Conceptualization of Spatial Relationships</para>
        /// <para><xdoc>
        ///   <para>Specifies how the weighting associated with each spatial relationship is specified.</para>
        ///   <bulletList>
        ///     <bullet_item>Inverse—Features farther away have a smaller weight than features nearby.</bullet_item><para/>
        ///     <bullet_item>Fixed—Features within the Impedance Cutoff are neighbors (weight of 1); features outside the Impedance Cutoff are not weighted (weight of 0).</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何指定与每个空间关系关联的权重。</para>
        ///   <bulletList>
        ///     <bullet_item>反转 - 较远的要素比附近的要素具有更小的权重。</bullet_item><para/>
        ///     <bullet_item>固定 - 阻抗截止内的特征是相邻的（权重为 1）;阻抗截止值之外的特征不会加权（权重为 0）。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Conceptualization of Spatial Relationships")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _Conceptualization_of_Spatial_Relationships_value _Conceptualization_of_Spatial_Relationships { get; set; } = _Conceptualization_of_Spatial_Relationships_value._INVERSE;

        public enum _Conceptualization_of_Spatial_Relationships_value
        {
            /// <summary>
            /// <para>Inverse</para>
            /// <para>Inverse—Features farther away have a smaller weight than features nearby.</para>
            /// <para>反转 - 较远的要素比附近的要素具有更小的权重。</para>
            /// </summary>
            [Description("Inverse")]
            [GPEnumValue("INVERSE")]
            _INVERSE,

            /// <summary>
            /// <para>Fixed</para>
            /// <para>Fixed—Features within the Impedance Cutoff are neighbors (weight of 1); features outside the Impedance Cutoff are not weighted (weight of 0).</para>
            /// <para>固定 - 阻抗截止内的特征是相邻的（权重为 1）;阻抗截止值之外的特征不会加权（权重为 0）。</para>
            /// </summary>
            [Description("Fixed")]
            [GPEnumValue("FIXED")]
            _FIXED,

        }

        /// <summary>
        /// <para>Exponent</para>
        /// <para>Parameter for the Inverse Conceptualization of Spatial Relationships calculation. Typical values are 1 or 2. Weights drop off quicker with distance as this exponent value increases.</para>
        /// <para>空间关系的逆概念化计算参数。典型值为 1 或 2。随着该指数值的增加，权重会随着距离的增加而下降得更快。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Exponent")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _Exponent { get; set; } = 1;


        /// <summary>
        /// <para>Row Standardization</para>
        /// <para><xdoc>
        ///   <para>Specifies whether row standardization is applied. Row standardization is recommended whenever feature distribution is potentially biased due to sampling design or to an imposed aggregation scheme.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Spatial weights are standardized by row. Each weight is divided by its row sum.</bullet_item><para/>
        ///     <bullet_item>Unchecked—No standardization of spatial weights is applied.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否应用行标准化。每当特征分布可能由于抽样设计或强加的聚合方案而产生偏差时，建议进行行标准化。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 空间权重按行进行标准化。每个权重除以其行总和。</bullet_item><para/>
        ///     <bullet_item>未选中 - 未应用空间权重的标准化。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Row Standardization")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _Row_Standardization_value _Row_Standardization { get; set; } = _Row_Standardization_value._true;

        public enum _Row_Standardization_value
        {
            /// <summary>
            /// <para>ROW_STANDARDIZATION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ROW_STANDARDIZATION")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_STANDARDIZATION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_STANDARDIZATION")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Travel Mode</para>
        /// <para><xdoc>
        ///   <para>The mode of transportation for the analysis. Custom is always a choice. For other travel modes to appear, they must be present in the network dataset specified in the Network Dataset parameter.</para>
        ///   <para>A travel mode is defined on a network dataset and provides override values for parameters that model car, truck, pedestrian, or other modes of travel.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于分析的运输方式。定制始终是一种选择。要显示其他出行模式，它们必须存在于网络数据集参数中指定的网络数据集中。</para>
        ///   <para>出行模式在网络数据集上定义，并为对汽车、卡车、行人或其他出行模式进行建模的参数提供覆盖值。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Travel Mode")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _Travel_Mode { get; set; } = null;


        /// <summary>
        /// <para>Time of Day</para>
        /// <para>Specifies whether travel times should consider traffic conditions. Especially in urbanized areas, traffic conditions can significantly impact the area covered within a specified travel time. If no date or time is specified, the distance covered during a specified travel time will not be impacted by traffic.</para>
        /// <para>指定行驶时间是否应考虑交通状况。特别是在城市化地区，交通状况会显着影响指定旅行时间内所覆盖的区域。如果未指定日期或时间，则在指定行程时间内行驶的距离不会受到交通的影响。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time of Day")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _Time_of_Day { get; set; } = null;


        public GenerateNetworkSpatialWeights SetEnv(object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}